package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.book.common.annotation.group.InsertGroup;
import com.book.common.annotation.group.UpdateGroup;
import com.book.common.core.domain.BaseEntity;
import com.book.system.domain.vo.AppUserVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;

/**
 * @author Bigboss
 * @create 2024-11-10 14:10
 */
@TableName("followers")
@ApiModel(description = "关注表")
public class Followers extends BaseEntity {

    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 关注者id
     */
    private String follower;


    /**
     * 被关注者id
     */
    @NotBlank(message = "请选择你要关注的人",groups = {InsertGroup.class, UpdateGroup.class})
    private String followedPerson;


    /**
     * 关注者信息
     */
    @TableField(exist = false)
    private AppUserVo followerUser;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFollower() {
        return follower;
    }

    public void setFollower(String follower) {
        this.follower = follower;
    }

    public String getFollowedPerson() {
        return followedPerson;
    }

    public void setFollowedPerson(String followedPerson) {
        this.followedPerson = followedPerson;
    }

    public AppUserVo getFollowerUser() {
        return followerUser;
    }

    public void setFollowerUser(AppUserVo followerUser) {
        this.followerUser = followerUser;
    }

    @Override
    public String toString() {
        return "Followers{" +
                "id='" + id + '\'' +
                ", follower='" + follower + '\'' +
                ", followedPerson='" + followedPerson + '\'' +
                '}';
    }
}
